package com.mygame;

import java.util.Random;

import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.util.Log;

public class Sprite {
	
	private GameView gameView;
	private Bitmap bmp;
	private float x;
	private float y;
	private float width;
	private float height;
	private int Speed;
		
	
	public Sprite(GameView gameView, Bitmap bmp)
	{
		this.gameView = gameView;
		this.bmp = bmp;
		this.width = bmp.getWidth();
		this.height = bmp.getHeight();
		
		 Random rnd = new Random();
         x = rnd.nextInt(200);
         y = rnd.nextInt(300);
         
         Speed = 10;
	}
	
	public boolean isCollition(float x2, float y2)
    {
    	return x2 > x && x2 < x + width && y2 > y && y2 < y + height;
    }
	
		
	public void onDraw(Canvas canvas)
	{
		canvas.drawBitmap(bmp, x, y, null);
	}

	public float GetX()
	{
		return x;
	}
	
	public float GetY()
	{
		return y;
	}
	
	public float GetWidth()
	{
		return width;
	}
	
	public float GetHeight()
	{
		return height;
	}
}
